import io.minio.MinioClient;
import io.minio.UploadObjectArgs;

public class UploadTest {

    static MinioClient minioClient = MinioClient.builder()
            .endpoint("http://localhost:9000")
            .credentials("minioadmin", "minioadmin")
            .build();

    public static void main(String[] args) {
        //根据扩展名取出mimeType

        try {
            UploadObjectArgs test = UploadObjectArgs.builder()
                    .bucket("test")
                    .object("001/test001.mp4")
                    .filename("D:\\video3.mp4")
                    .contentType("video/mp4")
                    .build();
            minioClient.uploadObject(test);
            System.out.println("上传成功");
        } catch (Exception e) {
            e.printStackTrace();
            System.out.println("上传失败");
        }
    }
}
